﻿@using SelfManagement.Web.Models.ViewModels.AccountModels;
@model MyProfileViewModel

@section Styles{
    @Styles.Render(BundleConfig.BootstrapUploadCssBundle)
}

@section Scripts{
    @Scripts.Render(BundleConfig.BootstrapUploadJsBundle)
    <script type="text/javascript">
    </script>
}

<!-- BEGIN FORM PORTLET -->
<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-reorder"></i>账户设置
        </div>
    </div>
    <div class="portlet-body form">

        @using (Html.BeginForm("MyProfile", "Account", FormMethod.Post, new { @class = "form-horizontal js-form js-ajax-form" }))
        {
            @Html.AntiForgeryToken()
            <div class="form-body">

                <div class="form-group">
                    <label class="control-label col-md-3">选择头像</label>
                    <div class="col-md-7">
                        @Html.Partial("_BootstrapFileUploadImg",
                                        new ViewDataDictionary() {
                                            {"name","Face" },
                                            {"oriUrl",Url.Content(Model.UserFace??(ViewBag.DefaultUserFaceImagePath as string)) }
                                        }
                                    )
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.TrueName)
                    </label>
                    <div class="col-md-7">
                        @Html.TextBoxFor(m => m.TrueName, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.TrueName)
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.Sex)
                    </label>
                    <div class="col-md-7">
                        @Html.DropDownListFor(m => m.Sex,  Model.SexOptions, new { @class = "form-control" })
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.Identity)
                    </label>
                    <div class="col-md-7">
                        @Html.TextAreaFor(m => m.Identity, new { @class = "form-control", rows = 2, placeholder = "如：福州软件职业技术学院 毕业生" })
                        @Html.ValidationMessageFor(m => m.Identity)
                    </div>
                </div>


                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.PersonalInfo)
                    </label>
                    <div class="col-md-7">
                        @Html.TextAreaFor(m => m.PersonalInfo, new { @class = "form-control", rows = 6 })
                        @Html.ValidationMessageFor(m => m.PersonalInfo)
                    </div>
                </div>


                <h3 class="form-section">密码修改(若不修改，请留空)</h3>

                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.Password)
                    </label>
                    <div class="col-md-7">
                        @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Password)
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.NewPassword)
                    </label>
                    <div class="col-md-7">
                        @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.NewPassword)
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-3 control-label">
                        @Html.DisplayNameFor(m => m.RPassword)
                    </label>
                    <div class="col-md-7">
                        @Html.PasswordFor(m => m.RPassword, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.RPassword)
                    </div>
                </div>
            </div>
            <div class="form-actions fluid">
                <div class="col-md-offset-3 col-md-9">
                    <button type="submit" class="btn btn-success">保存</button>
                    <a href="@HttpContext.Current.Request.UrlReferrer" class="btn btn-default">取消</a>
                </div>
            </div>
        }

    </div>
</div>

